
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

section.profile-bar
    div.profile-image-wrapper(ng-class="::{'is-current-user': vm.isCurrentUser}")
        img.profile-img(
            tg-avatar-big="vm.user"
            alt="{{::vm.user.get('full_name')}}"
        )
        a.profile-edition(
          title="{{ 'USER.PROFILE.USER_SETTINGS' | translate }}",
          tg-nav="user-settings-user-profile",
          translate="USER.PROFILE.USER_SETTINGS"
        )
    div.profile-data
        h1(ng-class="{'not-full-name': !vm.user.get('full_name')}") {{::vm.user.get("full_name_display")}}
        .username @{{::vm.user.get("username")}}
        h2 {{::vm.stats.get('roles').join(", ")}}
    div.profile-stats
        div.stat
            span.stat-number {{::vm.stats.get('total_num_projects')}}
            span.stat-name(translate="USER.PROFILE.PROJECTS")
        div.stat
            span.stat-number {{::vm.stats.get('total_num_closed_userstories')}}
            span.stat-name(translate="USER.PROFILE.CLOSED_US")
        div.stat
            span.stat-number {{::vm.stats.get('total_num_contacts')}}
            span.stat-name(translate="USER.PROFILE.CONTACTS")

    div.profile-quote(ng-if="::vm.user.get('bio')")
        span {{::vm.user.get("bio") | limitTo:210 }}{{vm.user.get("bio").length < 210 ? '' : '...'}}
